<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获取两个set的并集</title>
</head>

<body>
    <script>
        let a = new Set([1,2,3,4,5])
        let b = new Set([10,4,3,2,9])
        //...扩展运算符
        let union = [...new Set([...a, ...b])];
        console.log(union);
    </script>
</body>
</html>